package com.lzw.breezeNovel.webApp.controller.novel;

import com.lzw.breezeNovel.common.result.Result;
import com.lzw.breezeNovel.webApp.service.novel.AuthorService;
import com.lzw.breezeNovel.webApp.vo.novel.AuthorVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.controller
 * @date 2025/3/3
 * @description 作者控制层
 */
@RestController
@RequestMapping("/app/author")
@SuppressWarnings("all")
public class AuthorController {

    /**
     * 作者服务
     */
    @Autowired
    private AuthorService authorService;

    /**
     * 根据作者名称查询书籍
     */
    @GetMapping("/getAuthorByBookId")
    public Result<AuthorVo> getAuthorByBookId(@RequestParam String authorName){
        AuthorVo authorVo = authorService.getAuthorByBookId(authorName);
        return Result.ok(authorVo);
    }

}
